//authors: Jonathan Su and Jeff Forte

import java.util.Hashtable;
import javax.swing.*;

/**
 * A labeled slider that reports values within the given range, inclusive.
 * 
 * @author Robert C. Duvall
 */
@SuppressWarnings("serial")
public class RangeSlider extends JSlider {
	public RangeSlider(String title, int minValue, int maxValue, int setValue, int spacing) {
		super(minValue, maxValue, setValue); 
        setMajorTickSpacing(spacing);
        setPaintTicks(true);
        setPaintLabels(true);
        // label range reasonably
        Hashtable<Integer, JLabel> labelTable = new Hashtable<Integer, JLabel>();
        labelTable.put(minValue, new JLabel(Integer.toString(minValue)));
        labelTable.put(maxValue, new JLabel(Integer.toString(maxValue)));
        setLabelTable(labelTable);
        setPaintLabels(true);
        setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), title));
	}
	
	
	

}

